<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>miniFOC: algorithm/report.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="Acme_LOGO.png"/></td>
  <td id="projectalign">
   <div id="projectname">miniFOC<span id="projectnumber">&#160;1.0.3</span>
   </div>
   <div id="projectbrief">This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_99d3723365464dd656f512988bb8dbbd.html">algorithm</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">report.c</div></div>
</div><!--header-->
<div class="contents">
<a href="report_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/**************************************************************************/</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="main_8h.html">main.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="report_8c.html#a39f7667109df28fd65d1b391498f043f">   15</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="report_8c.html#a39f7667109df28fd65d1b391498f043f">report_local_variable</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> upload_var[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span>    <span class="comment">/* compress the angle deviation and motor phase sequence into a 32-bit integer */</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    upload_var[0] = (<a class="code hl_variable" href="encoder_8c.html#a562eacc7259f25574b1ab8ce9d7c6a3e">machine_angle_offset</a> &lt;&lt; 16) | <a class="code hl_variable" href="foc_8c.html#ad335385ea3909d9485703d97735b34ca">phase_sequence</a> | <a class="code hl_variable" href="foc_8c.html#a418bbe3f3019eaefea9f904a87cf0a05">foc_parameter_available_flag</a> &lt;&lt; 1</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>        | <a class="code hl_variable" href="pid_8c.html#a48934d9569b54761658f7fe0484db10c">pid_parameter_available_flag</a> &lt;&lt; 2;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>    <span class="comment">/* converts user expect value to an integer */</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>    <span class="keywordflow">switch</span> (<a class="code hl_variable" href="pid_8c.html#a2c7bcbec66fa40a2347b1cd253a5ae82">pid_control_mode_flag</a>) {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>        <span class="keywordflow">default</span>:</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>        <span class="keywordflow">case</span> <a class="code hl_define" href="pid_8h.html#a8ffc8824a06f7892f9691a65b83982a7">TORQUE_LOOP_CONTROL</a>:upload_var[1] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="foc_8c.html#a6c9e1e8356380a4129a3a59d52ee1ec4">FOC_Struct</a>.<a class="code hl_variable" href="struct_f_o_c___structure__t.html#a483644b553c2be32ffbaf641f23c6cea">user_expect</a>);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>            <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span>        <span class="keywordflow">case</span> <a class="code hl_define" href="pid_8h.html#aa5ef3ead33ee14a82e7ee277d31e02d1">SPEED_LOOP_CONTROL</a>:upload_var[1] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#ab051c8f4a730b934b146f330514efd95">speed_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#ad0e13a810b1a4602c1ce625f9877cbf5">expect</a>);</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>            <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>        <span class="keywordflow">case</span> <a class="code hl_define" href="pid_8h.html#a7dad3a985101eaec7ac078f43747c928">ANGLE_LOOP_CONTROL</a>:upload_var[1] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#aaa8f5bad87ffc78a20f06863ab6bad5c">angle_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#ad0e13a810b1a4602c1ce625f9877cbf5">expect</a>);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>            <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>    }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>    <span class="comment">/* converts speed pid parameters to an integer */</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>    upload_var[2] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#ab051c8f4a730b934b146f330514efd95">speed_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#a1f7add0f84d583bc2eceb290d6c4cc06">kp</a>);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    upload_var[3] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#ab051c8f4a730b934b146f330514efd95">speed_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#a050993b7ca6c97e62c1020017f716b91">ki</a>);</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>    upload_var[4] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#ab051c8f4a730b934b146f330514efd95">speed_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#ae7a5c6018507bb1361fcca170e069b9c">kd</a>);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    upload_var[5] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#ab051c8f4a730b934b146f330514efd95">speed_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#a51379d672c255e751fb020ef2394a8f0">sum_maximum</a>);</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    <span class="comment">/* converts angle pid parameters to an integer */</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>    upload_var[6] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#aaa8f5bad87ffc78a20f06863ab6bad5c">angle_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#a1f7add0f84d583bc2eceb290d6c4cc06">kp</a>);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>    upload_var[7] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#aaa8f5bad87ffc78a20f06863ab6bad5c">angle_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#a050993b7ca6c97e62c1020017f716b91">ki</a>);</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    upload_var[8] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#aaa8f5bad87ffc78a20f06863ab6bad5c">angle_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#ae7a5c6018507bb1361fcca170e069b9c">kd</a>);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    upload_var[9] = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="pid_8c.html#aaa8f5bad87ffc78a20f06863ab6bad5c">angle_pid_handler</a>.<a class="code hl_variable" href="struct_p_i_d___structure__t.html#a51379d672c255e751fb020ef2394a8f0">sum_maximum</a>);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> counter = 0; counter &lt; 5; ++counter) {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>        <span class="comment">/* separates 32-bit integer data into 8-bit integers */</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>        buffer[0] = (<span class="keywordtype">unsigned</span> char) ((upload_var[counter * 2] &gt;&gt; 24UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>        buffer[1] = (<span class="keywordtype">unsigned</span> char) ((upload_var[counter * 2] &gt;&gt; 16UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>        buffer[2] = (<span class="keywordtype">unsigned</span> char) ((upload_var[counter * 2] &gt;&gt; 8UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>        buffer[3] = (<span class="keywordtype">unsigned</span> char) (upload_var[counter * 2] &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>        <span class="comment">/* separates 32-bit integer data into 8-bit integers */</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>        buffer[4] = (<span class="keywordtype">unsigned</span> char) ((upload_var[counter * 2 + 1] &gt;&gt; 24UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>        buffer[5] = (<span class="keywordtype">unsigned</span> char) ((upload_var[counter * 2 + 1] &gt;&gt; 16UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>        buffer[6] = (<span class="keywordtype">unsigned</span> char) ((upload_var[counter * 2 + 1] &gt;&gt; 8UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>        buffer[7] = (<span class="keywordtype">unsigned</span> char) (upload_var[counter * 2 + 1] &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>        <span class="comment">/* packet and send through medium capacity data transmission protocol */</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>        <a class="code hl_function" href="uart_8c.html#ab01834c3618e9e1078f1b7e9512337c6">mdtp_data_transmit</a>(0x01 + counter, buffer);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>        <a class="code hl_define" href="led_8h.html#a927d8328da439f32fe78f647b70db599">led_toggle</a>();</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>        <a class="code hl_function" href="system_8c.html#a837b6e9a8c812f0964f71e37ac853bff">delayms</a>(20);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>    }</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>}</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="report_8c.html#ad34fcba452be8c07f046c3a11950d41c">   69</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="report_8c.html#ad34fcba452be8c07f046c3a11950d41c">report_angle_speed</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    <span class="comment">/* converts velocity and angle floating point data to an integer */</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> velocity = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="foc_8c.html#a6c9e1e8356380a4129a3a59d52ee1ec4">FOC_Struct</a>.<a class="code hl_variable" href="struct_f_o_c___structure__t.html#af32f899f7a231c9df64a594c7b13bfa4">rotate_speed</a>);</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> angle = <a class="code hl_function" href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a>(<a class="code hl_variable" href="foc_8c.html#a6c9e1e8356380a4129a3a59d52ee1ec4">FOC_Struct</a>.<a class="code hl_variable" href="struct_f_o_c___structure__t.html#af832998676bd09b4198a7a7274072766">mechanical_angle</a>);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>    <span class="comment">/* separates 32-bit velocity integer into 8-bit integers */</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>    buffer[0] = (<span class="keywordtype">unsigned</span> char) ((velocity &gt;&gt; 24UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>    buffer[1] = (<span class="keywordtype">unsigned</span> char) ((velocity &gt;&gt; 16UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>    buffer[2] = (<span class="keywordtype">unsigned</span> char) ((velocity &gt;&gt; 8UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    buffer[3] = (<span class="keywordtype">unsigned</span> char) (velocity &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>    <span class="comment">/* separates 32-bit angle integer into 8-bit integers */</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>    buffer[4] = (<span class="keywordtype">unsigned</span> char) ((angle &gt;&gt; 24UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>    buffer[5] = (<span class="keywordtype">unsigned</span> char) ((angle &gt;&gt; 16UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>    buffer[6] = (<span class="keywordtype">unsigned</span> char) ((angle &gt;&gt; 8UL) &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>    buffer[7] = (<span class="keywordtype">unsigned</span> char) (angle &amp; 0x000000ffUL);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    <span class="comment">/* packet and send through medium capacity data transmission protocol */</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>    <a class="code hl_function" href="uart_8c.html#ab01834c3618e9e1078f1b7e9512337c6">mdtp_data_transmit</a>(0x00, buffer);</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>}</div>
<div class="ttc" id="aencoder_8c_html_a562eacc7259f25574b1ab8ce9d7c6a3e"><div class="ttname"><a href="encoder_8c.html#a562eacc7259f25574b1ab8ce9d7c6a3e">machine_angle_offset</a></div><div class="ttdeci">volatile unsigned short machine_angle_offset</div><div class="ttdoc">mechanical angle offset, which is used to align the mechanical angle with the zero point of the elect...</div><div class="ttdef"><b>Definition:</b> <a href="encoder_8c_source.html#l00023">encoder.c:23</a></div></div>
<div class="ttc" id="afoc_8c_html_a418bbe3f3019eaefea9f904a87cf0a05"><div class="ttname"><a href="foc_8c.html#a418bbe3f3019eaefea9f904a87cf0a05">foc_parameter_available_flag</a></div><div class="ttdeci">unsigned char foc_parameter_available_flag</div><div class="ttdoc">flag variable for FOC parameter availability</div><div class="ttdef"><b>Definition:</b> <a href="foc_8c_source.html#l00028">foc.c:28</a></div></div>
<div class="ttc" id="afoc_8c_html_a6c9e1e8356380a4129a3a59d52ee1ec4"><div class="ttname"><a href="foc_8c.html#a6c9e1e8356380a4129a3a59d52ee1ec4">FOC_Struct</a></div><div class="ttdeci">volatile FOC_Structure_t FOC_Struct</div><div class="ttdoc">FOC handler.</div><div class="ttdef"><b>Definition:</b> <a href="foc_8c_source.html#l00020">foc.c:20</a></div></div>
<div class="ttc" id="afoc_8c_html_ad335385ea3909d9485703d97735b34ca"><div class="ttname"><a href="foc_8c.html#ad335385ea3909d9485703d97735b34ca">phase_sequence</a></div><div class="ttdeci">volatile unsigned char phase_sequence</div><div class="ttdoc">motor phase sequence flag variable</div><div class="ttdef"><b>Definition:</b> <a href="foc_8c_source.html#l00024">foc.c:24</a></div></div>
<div class="ttc" id="aled_8h_html_a927d8328da439f32fe78f647b70db599"><div class="ttname"><a href="led_8h.html#a927d8328da439f32fe78f647b70db599">led_toggle</a></div><div class="ttdeci">#define led_toggle()</div><div class="ttdoc">flip the LED pin level</div><div class="ttdef"><b>Definition:</b> <a href="led_8h_source.html#l00025">led.h:25</a></div></div>
<div class="ttc" id="amain_8h_html"><div class="ttname"><a href="main_8h.html">main.h</a></div><div class="ttdoc">main function Header File</div></div>
<div class="ttc" id="apid_8c_html_a2c7bcbec66fa40a2347b1cd253a5ae82"><div class="ttname"><a href="pid_8c.html#a2c7bcbec66fa40a2347b1cd253a5ae82">pid_control_mode_flag</a></div><div class="ttdeci">volatile unsigned char pid_control_mode_flag</div><div class="ttdoc">flag variable of PID closed loop mode</div><div class="ttdef"><b>Definition:</b> <a href="pid_8c_source.html#l00020">pid.c:20</a></div></div>
<div class="ttc" id="apid_8c_html_a48934d9569b54761658f7fe0484db10c"><div class="ttname"><a href="pid_8c.html#a48934d9569b54761658f7fe0484db10c">pid_parameter_available_flag</a></div><div class="ttdeci">unsigned char pid_parameter_available_flag</div><div class="ttdoc">flag variable for PID parameter availability</div><div class="ttdef"><b>Definition:</b> <a href="pid_8c_source.html#l00016">pid.c:16</a></div></div>
<div class="ttc" id="apid_8c_html_aaa8f5bad87ffc78a20f06863ab6bad5c"><div class="ttname"><a href="pid_8c.html#aaa8f5bad87ffc78a20f06863ab6bad5c">angle_pid_handler</a></div><div class="ttdeci">volatile PID_Structure_t angle_pid_handler</div><div class="ttdoc">algorithm handler of PID angle loop</div><div class="ttdef"><b>Definition:</b> <a href="pid_8c_source.html#l00028">pid.c:28</a></div></div>
<div class="ttc" id="apid_8c_html_ab051c8f4a730b934b146f330514efd95"><div class="ttname"><a href="pid_8c.html#ab051c8f4a730b934b146f330514efd95">speed_pid_handler</a></div><div class="ttdeci">volatile PID_Structure_t speed_pid_handler</div><div class="ttdoc">algorithm handler of PID speed loop</div><div class="ttdef"><b>Definition:</b> <a href="pid_8c_source.html#l00024">pid.c:24</a></div></div>
<div class="ttc" id="apid_8h_html_a7dad3a985101eaec7ac078f43747c928"><div class="ttname"><a href="pid_8h.html#a7dad3a985101eaec7ac078f43747c928">ANGLE_LOOP_CONTROL</a></div><div class="ttdeci">#define ANGLE_LOOP_CONTROL</div><div class="ttdoc">angle loop control mode</div><div class="ttdef"><b>Definition:</b> <a href="pid_8h_source.html#l00018">pid.h:18</a></div></div>
<div class="ttc" id="apid_8h_html_a8ffc8824a06f7892f9691a65b83982a7"><div class="ttname"><a href="pid_8h.html#a8ffc8824a06f7892f9691a65b83982a7">TORQUE_LOOP_CONTROL</a></div><div class="ttdeci">#define TORQUE_LOOP_CONTROL</div><div class="ttdoc">torque loop control mode</div><div class="ttdef"><b>Definition:</b> <a href="pid_8h_source.html#l00014">pid.h:14</a></div></div>
<div class="ttc" id="apid_8h_html_aa5ef3ead33ee14a82e7ee277d31e02d1"><div class="ttname"><a href="pid_8h.html#aa5ef3ead33ee14a82e7ee277d31e02d1">SPEED_LOOP_CONTROL</a></div><div class="ttdeci">#define SPEED_LOOP_CONTROL</div><div class="ttdoc">speed loop control mode</div><div class="ttdef"><b>Definition:</b> <a href="pid_8h_source.html#l00016">pid.h:16</a></div></div>
<div class="ttc" id="areport_8c_html_a39f7667109df28fd65d1b391498f043f"><div class="ttname"><a href="report_8c.html#a39f7667109df28fd65d1b391498f043f">report_local_variable</a></div><div class="ttdeci">void report_local_variable(void)</div><div class="ttdoc">report PID parameters and current user settings</div><div class="ttdef"><b>Definition:</b> <a href="report_8c_source.html#l00015">report.c:15</a></div></div>
<div class="ttc" id="areport_8c_html_ad34fcba452be8c07f046c3a11950d41c"><div class="ttname"><a href="report_8c.html#ad34fcba452be8c07f046c3a11950d41c">report_angle_speed</a></div><div class="ttdeci">void report_angle_speed(void)</div><div class="ttdoc">report angle and speed using medium capacity transport protocol</div><div class="ttdef"><b>Definition:</b> <a href="report_8c_source.html#l00069">report.c:69</a></div></div>
<div class="ttc" id="astruct_f_o_c___structure__t_html_a483644b553c2be32ffbaf641f23c6cea"><div class="ttname"><a href="struct_f_o_c___structure__t.html#a483644b553c2be32ffbaf641f23c6cea">FOC_Structure_t::user_expect</a></div><div class="ttdeci">float user_expect</div><div class="ttdoc">user expect value of miniFOC</div><div class="ttdef"><b>Definition:</b> <a href="foc_8h_source.html#l00020">foc.h:20</a></div></div>
<div class="ttc" id="astruct_f_o_c___structure__t_html_af32f899f7a231c9df64a594c7b13bfa4"><div class="ttname"><a href="struct_f_o_c___structure__t.html#af32f899f7a231c9df64a594c7b13bfa4">FOC_Structure_t::rotate_speed</a></div><div class="ttdeci">float rotate_speed</div><div class="ttdoc">motor rotate speed calculate from timer</div><div class="ttdef"><b>Definition:</b> <a href="foc_8h_source.html#l00019">foc.h:19</a></div></div>
<div class="ttc" id="astruct_f_o_c___structure__t_html_af832998676bd09b4198a7a7274072766"><div class="ttname"><a href="struct_f_o_c___structure__t.html#af832998676bd09b4198a7a7274072766">FOC_Structure_t::mechanical_angle</a></div><div class="ttdeci">float mechanical_angle</div><div class="ttdoc">mechanical angle read form encoder</div><div class="ttdef"><b>Definition:</b> <a href="foc_8h_source.html#l00018">foc.h:18</a></div></div>
<div class="ttc" id="astruct_p_i_d___structure__t_html_a050993b7ca6c97e62c1020017f716b91"><div class="ttname"><a href="struct_p_i_d___structure__t.html#a050993b7ca6c97e62c1020017f716b91">PID_Structure_t::ki</a></div><div class="ttdeci">float ki</div><div class="ttdoc">integral term coefficient in PID</div><div class="ttdef"><b>Definition:</b> <a href="pid_8h_source.html#l00026">pid.h:26</a></div></div>
<div class="ttc" id="astruct_p_i_d___structure__t_html_a1f7add0f84d583bc2eceb290d6c4cc06"><div class="ttname"><a href="struct_p_i_d___structure__t.html#a1f7add0f84d583bc2eceb290d6c4cc06">PID_Structure_t::kp</a></div><div class="ttdeci">float kp</div><div class="ttdoc">proportional term coefficient in PID</div><div class="ttdef"><b>Definition:</b> <a href="pid_8h_source.html#l00025">pid.h:25</a></div></div>
<div class="ttc" id="astruct_p_i_d___structure__t_html_a51379d672c255e751fb020ef2394a8f0"><div class="ttname"><a href="struct_p_i_d___structure__t.html#a51379d672c255e751fb020ef2394a8f0">PID_Structure_t::sum_maximum</a></div><div class="ttdeci">float sum_maximum</div><div class="ttdoc">maximum of anti saturation integral in PID</div><div class="ttdef"><b>Definition:</b> <a href="pid_8h_source.html#l00032">pid.h:32</a></div></div>
<div class="ttc" id="astruct_p_i_d___structure__t_html_ad0e13a810b1a4602c1ce625f9877cbf5"><div class="ttname"><a href="struct_p_i_d___structure__t.html#ad0e13a810b1a4602c1ce625f9877cbf5">PID_Structure_t::expect</a></div><div class="ttdeci">float expect</div><div class="ttdoc">user expectations in PID</div><div class="ttdef"><b>Definition:</b> <a href="pid_8h_source.html#l00029">pid.h:29</a></div></div>
<div class="ttc" id="astruct_p_i_d___structure__t_html_ae7a5c6018507bb1361fcca170e069b9c"><div class="ttname"><a href="struct_p_i_d___structure__t.html#ae7a5c6018507bb1361fcca170e069b9c">PID_Structure_t::kd</a></div><div class="ttdeci">float kd</div><div class="ttdoc">differential term coefficient in PID</div><div class="ttdef"><b>Definition:</b> <a href="pid_8h_source.html#l00027">pid.h:27</a></div></div>
<div class="ttc" id="asystem_8c_html_a7bee5a9ca4038926b7fd4c38976d1481"><div class="ttname"><a href="system_8c.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a></div><div class="ttdeci">unsigned int float_to_int32(float data0)</div><div class="ttdoc">convert floating point numbers to int32 type data</div><div class="ttdef"><b>Definition:</b> <a href="system_8c_source.html#l00060">system.c:60</a></div></div>
<div class="ttc" id="asystem_8c_html_a837b6e9a8c812f0964f71e37ac853bff"><div class="ttname"><a href="system_8c.html#a837b6e9a8c812f0964f71e37ac853bff">delayms</a></div><div class="ttdeci">void delayms(unsigned long count)</div><div class="ttdoc">millisecond delay function, any time time.</div><div class="ttdef"><b>Definition:</b> <a href="system_8c_source.html#l00030">system.c:30</a></div></div>
<div class="ttc" id="auart_8c_html_ab01834c3618e9e1078f1b7e9512337c6"><div class="ttname"><a href="uart_8c.html#ab01834c3618e9e1078f1b7e9512337c6">mdtp_data_transmit</a></div><div class="ttdeci">void mdtp_data_transmit(unsigned char pid, const unsigned char *buffer)</div><div class="ttdoc">medium capacity data transmission protocol packing function</div><div class="ttdef"><b>Definition:</b> <a href="uart_8c_source.html#l00113">uart.c:113</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
